<?php
include "utility_functions.php";

if (!empty($_SESSION['user_id'])) {
  verify_privileges($page_type);
}
else {
  if ($current_page != "index.php" and $current_page != "login.php" and $current_page != "error_page.php") {
	header("Location:error_page.php");
  }
}
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head> 
<title>Student Enrollment System</title>
<h1>Student Enrollment System</h1>
<style type="text/css"> 
<!-- 
h1 {
  font-family: sans-serif;
  font-size:40px;
}

h2 {
  font-family: sans-serif;
}

h3 {
  font-family: sans-serif;
}

#navbar ul { 
  margin: 0px; 
  padding: 0; 
  list-style: none; 
  width: 90%; 
} 
 
#navbar ul li {  
  font-weight: bold;
  display: inline;
} 
 
#navbar ul li a { 
  text-decoration: none;
  padding: 3px 0; 
  width: 170px;
  font-family: sans-serif;
  background: #FF9900; 
  color: #000000;
  float: left;  
  text-align: center;
  border-left:1px solid #fff;
} 
 
#navbar ul li a:hover { 
  color: #000000; 
  background: #FFCC00; 
} 
--> 
</style> 
</head> 
<body> 
<div id="navbar"> 
  <ul> 
    <?php
	  echo "<li><a href=\"index.php\">Home</a></li>"; 
	  if (empty($_SESSION['user_id'])) {
	    echo "<li><a href=\"login.php\">Login</a></li>"; 
	  }
	  else {
	    echo "<li><a href=\"logout_response.php?session_id={$_SESSION['session_id']}\">Logout</a></li>";
		echo "<li><a href=\"update_password.php\">Change Password</a></li>";
	  }
	  if (isset($_SESSION['sflag']) and $_SESSION['sflag'] == "1") {
	    echo "<li><a href=\"profile.php\">Profile</a></li> "; 
		echo "<li><a href=\"enroll.php\">Enrollment</a></li> ";
	  }
	  if (isset($_SESSION['aflag']) and $_SESSION['aflag'] == "1") {
	    echo "<li><a href=\"client.php\">Manage Users</a></li> "; 
		echo "<li><a href=\"student.php\">Manage Students</a></li>"; 
	  }
	?>
  </ul> 
</div>
<br>